import request from '@/utils/request'

const gsApi = '/goodsSpu';

export function pageGs(params) {
  return request({
    url: `${gsApi}/page`,
    method: 'get',
    params: params
  })
}

export function getCount(query) {
  return request({
    url: `${gsApi}/count`,
    method: 'get',
    params: query
  })
}

export function addGs(obj) {
  return request({
    url: `${gsApi}`,
    method: 'post',
    data: obj
  })
}

export function getGs(id) {
  return request({
    url: `${gsApi}/` + id,
    method: 'get'
  })
}

export function delGs(id) {
  return request({
    url: `${gsApi}/` + id,
    method: 'delete'
  })
}

export function updateGs(obj) {
  return request({
    url: `${gsApi}`,
    method: 'put',
    data: obj
  })
}

export function changeGsShelf(idList, shelf) {
  let data = {
    idList,
    shelf
  }
  return request({
    url: `${gsApi}/changeShelf`,
    method: 'put',
    data
  })
}
